package gui;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.CardLayout;
import java.util.Set;

public class Screen extends JFrame {

	public static final String LOGIN = "login";
	public static final String USERMENU = "userMenu";
	public static final String ADMINMENU = "adminMenu";
	public static final String SHOWBALANCE = "showBalance";
	public static final String DEPOSIT = "deposit";
	public static final String WITHDRAW = "withdraw";
	public static final String TRANSFER = "transfer";
	public static final String ADDUSER = "addUser";
	public static final String SHOWALL = "showAll";
	public static final String EXCHANGERATE = "exchangeRate";

	private JPanel contentPane;
	private Login login;
	private Usermenu userMenu;
	private Showbalance showBalance;
	private Deposit deposit;
	private Withdraw withdraw;
	private Transfer transfer;
	private AdminMenu adminMenu;
	private AddUser addUser;
	private ExchangeRate exchangeRate;
	private ShowAll showAll;
	private CardLayout c;
	
	/**
	 * Create the frame.
	 */
	public Screen() {
		setTitle("BCBS");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 335);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout(0, 0));
		setResizable(false);
		
		login = new Login();
		contentPane.add(login, LOGIN);

		userMenu = new Usermenu();
		contentPane.add(userMenu, USERMENU);

		showBalance = new Showbalance();
		contentPane.add(showBalance, SHOWBALANCE);

		deposit = new Deposit();
		contentPane.add(deposit, DEPOSIT);

		withdraw = new Withdraw();
		contentPane.add(withdraw, WITHDRAW);

		transfer = new Transfer();
		contentPane.add(transfer, TRANSFER);
		
		adminMenu = new AdminMenu();
		contentPane.add(adminMenu, ADMINMENU);

		addUser = new AddUser();
		contentPane.add(addUser, ADDUSER);
		
		showAll = new ShowAll();
		contentPane.add(showAll, SHOWALL);
		
		exchangeRate = new ExchangeRate();
		contentPane.add(exchangeRate, EXCHANGERATE);
		
		c = (CardLayout) getContentPane().getLayout();
	}

	public Login getLogin() {
		return login;
	}

	public Usermenu getUsermenu() {
		return userMenu;
	}

	public Showbalance getShowbalance() {
		return showBalance;
	}

	public Deposit getDeposit() {
		return deposit;
	}

	public Withdraw getWithdraw() {
		return withdraw;
	}

	public Transfer getTransfer() {
		return transfer;
	}

	public AdminMenu getAdminMenu() {
		return adminMenu;
	}

	public AddUser getAddUser() {
		return addUser;
	}
	
	public ShowAll getShowAll() {
		return showAll;
	}
	
	public ExchangeRate getExchangeRate() {
		return exchangeRate;
	}

	public void show(String card) {
		c.show(this.getContentPane(), card);
	}

}
